<!--
 * @Description  :
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-01-12 10:52:50
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-02-28 17:00:48
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\interface-docking\\components\\waybill\\load.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<!-- 搜索表单 -->
<page-header-wrapper [title]="''"> </page-header-wrapper>
<nz-card>
  <div nz-row nzGutter="8">
    <!-- 查询字段小于或等于3个时，不显示伸缩按钮 -->
    <div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
      <sf
        #sf
        [schema]="schema"
        [ui]="ui"
        [mode]="'search'"
        [disabled]="!sf?.valid"
        [loading]="false"
        (formSubmit)="st?.load(1)"
        (formReset)="resetSF()"
      ></sf>
    </div>

    <!-- 查询字段大于3个时，根据展开状态调整布局 -->
    <ng-container *ngIf="queryFieldCount > 3">
      <div nz-col [nzSpan]="_$expand ? 24 : 18">
        <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
      </div>
      <div nz-col [nzSpan]="_$expand ? 24 : 6" [class.text-right]="_$expand">
        <button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="search()" acl  [acl-ability]="['INTERFACE-LIST-searsh']">查询</button>
        <button nz-button [disabled]="false" (click)="resetSF()">重置</button>
        <button nz-button (click)="st?.export()">导出</button>
        <button nz-button nzType="link" (click)="expandToggle()">
          {{ !_$expand ? '展开' : '收起' }}
          <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
        </button>
      </div>
    </ng-container>
  </div>
</nz-card>

<nz-card>
  <nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
    <nz-tab [nzTitle]="'全部(' + tabs?.totalCount + ')'"></nz-tab>
    <nz-tab [nzTitle]="'已发布(' + tabs?.billStatus2 + ')'"></nz-tab>
    <nz-tab [nzTitle]="'已派车(' + tabs?.billStatus4 + ')'"></nz-tab>
    <nz-tab [nzTitle]="'报到(' + tabs?.billStatus8 + ')'"></nz-tab>
    <nz-tab [nzTitle]="'发运(' + tabs?.billStatus10 + ')'"></nz-tab>
    <nz-tab [nzTitle]="'到达(' + tabs?.billStatus12 + ')'"></nz-tab>
    <nz-tab [nzTitle]="'签收及回单上传(' + tabs?.billStatus14 + ')'"></nz-tab>

  </nz-tabset>
  <div style="margin-top: 15px">
    <st
      #st
      [bordered]="true"
      [scroll]="{ x: '2000px' }"
      [data]="service.$api_waybillInfo_list"
      [columns]="columns"
      [req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
      [res]="{ reName: { list: 'data.records', total: 'data.total' } }"
      [page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
      [loading]="false"
    >

    </st>
  </div>
</nz-card>

<ng-template #extraTemplate>
  <div class="d-flex align-items-center">
    <div class="mr-md">
      已选择
      <strong class="text-red">{{ selectedRows.length }}</strong> 条数据
    </div>

    <button nz-button nz-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomLeft">
      更多<i nz-icon nzType="down" nzTheme="outline"></i
    ></button>
    <nz-dropdown-menu #menu="nzDropdownMenu">
      <ul nz-menu>
        <li nz-menu-item (click)="noticeCheckIn('确认')" acl [acl-ability]="['INTERFACE-LIST-noticeCheckIn']" > 确认报到 </li>
        <li nz-menu-item (click)="noticeCheckIn('取消')" acl [acl-ability]="['INTERFACE-LIST-noticeCheckIn']"  > 取消报到 </li>
        <li nz-menu-item (click)="noticeShipment('确认')" acl [acl-ability]="['INTERFACE-LIST-noticeShipment']"  > 确认发运 </li>
        <li nz-menu-item (click)="noticeShipment('取消')" acl [acl-ability]="['INTERFACE-LIST-noticeShipment']"  > 取消发运 </li>
        <li nz-menu-item (click)="noticeArrive('确认')" acl [acl-ability]="['INTERFACE-LIST-noticeArrive']"  > 确认到达 </li>
        <li nz-menu-item (click)="noticeArrive('取消')" acl [acl-ability]="['INTERFACE-LIST-noticeArrive']"  > 取消到达 </li>
      </ul>
    </nz-dropdown-menu>
  </div>
</ng-template>

